<?php
/**
 * Created by PhpStorm.
 * User: zyark
 * Date: 2017/6/1
 * Time: 21:58
 */

namespace Admin\Logic;


class ShippingLogic
{
    function getSortShippings()
    {
        $list =  M("Shipping")->select();
        $nameList = array();
        foreach($list as $k => $v)
        {

            $name = getFirstCharter($v['shipping_name']) .'  --   '. $v['shipping_name']; // 前面加上拼音首字母

            $nameList[] = $v['shipping_name'] = $name;
            $list[$k] = $v;
        }
        array_multisort($nameList,SORT_STRING,SORT_ASC,$list);

        return $list;
    }
}